<template>
  <ul>
    <li :style="{'opacity':opacity,color:'red'}">你好世界！</li>
    <li >news001</li>
    <li >news002</li>
    <li >news003</li>
  </ul>
</template>

<script>
export default {
  name:'News',
  data() {
    return {
      opacity:1
    }
  },
  deactivated() {
    clearInterval(this.timer)
  },
  activated() {
   
    this.timer = setInterval(()=>{ 
      console.log('###');
      this.opacity -= 0.01
      if(this.opacity <= 0 ) {
        this.opacity = 1
      } 
    },20)
  },
}
</script>